/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface PmPreacceptance extends BasicModel<PmPreacceptance> {
  createDate?: string; // 发起时间
  projectname?: string; // 工程名称
  projectno?: string; // 工程编号
  djno?: string; // 预验收编号
  checkresult?: string; // 预验收结果
  createByName?: string; // 发起人
  createBy?: string; // 发起人编号
  acceptor?: string; // acceptor
  acceptorno?: string; // acceptorno
  acceptancetime?: string; // acceptancetime
  fileno?: string; // fileno
  changeno?: string; // changeno
  wastepipe?: string; // wastepipe
  checkmaterial?: string; // 材料核对
  checkmaterialtime?: string; // 材料核对时间
  filecheck?: string; // 验收方式
  filechecktime?: string; // filechecktime
  filecheckper?: string; // filecheckper
  canfilecheck?: string; // canfilecheck
  iswastepipe?: string; // iswastepipe
  filewastepipe?: string; // filewastepipe
  usercodepre?: string; // 负责人编码
  usernamepre?: string; // 负责人名称
  pmRectificationList?: any[]; // 子表列表
}

export const pmPreacceptanceList = (params?: PmPreacceptance | any) =>
  defHttp.get<PmPreacceptance>({ url: adminPath + '/accept/pre/pmPreacceptance/list', params });

export const pmPreacceptanceListData = (params?: PmPreacceptance | any) =>
  defHttp.post<Page<PmPreacceptance>>({
    url: adminPath + '/accept/pre/pmPreacceptance/listData',
    params,
  });

export const pmPreacceptanceForm = (params?: PmPreacceptance | any) =>
  defHttp.get<PmPreacceptance>({ url: adminPath + '/accept/pre/pmPreacceptance/form', params });

export const pmPreacceptanceSave = (params?: any, data?: PmPreacceptance | any) =>
  defHttp.postJson<PmPreacceptance>({
    url: adminPath + '/accept/pre/pmPreacceptance/save',
    params,
    data,
  });

export const pmPreacceptanceDisable = (params?: PmPreacceptance | any) =>
  defHttp.get<PmPreacceptance>({ url: adminPath + '/accept/pre/pmPreacceptance/disable', params });

export const pmPreacceptanceEnable = (params?: PmPreacceptance | any) =>
  defHttp.get<PmPreacceptance>({ url: adminPath + '/accept/pre/pmPreacceptance/enable', params });

export const pmPreacceptanceDelete = (params?: PmPreacceptance | any) =>
  defHttp.get<PmPreacceptance>({ url: adminPath + '/accept/pre/pmPreacceptance/delete', params });

// 材料核对
export const pmPreacceptanceCheck = (params?: PmPreacceptance | any) =>
  defHttp.get<PmPreacceptance>({ url: adminPath + '/accept/pre/pmPreacceptance/check', params });

// 竣工准备就绪
export const pmPreacceptancePush = (params?: PmPreacceptance | any) =>
  defHttp.get<PmPreacceptance>({ url: adminPath + '/accept/pre/pmPreacceptance/push', params });

// 竣工验收发起
export const pmPreacceptanceListDataJG = (params?: PmPreacceptance | any) =>
  defHttp.post<Page<PmPreacceptance>>({
    url: adminPath + '/accept/pre/pmPreacceptance/listDataJg',
    params,
  });
